/* USER CODE BEGIN Header */
/**
  ******************************************************************************
  * @file           : main.h
  * @brief          : Header for main.c file.
  *                   This file contains the common defines of the application.
  ******************************************************************************
  * @attention
  *
  * <h2><center>&copy; Copyright (c) 2021 STMicroelectronics.
  * All rights reserved.</center></h2>
  *
  * This software component is licensed by ST under BSD 3-Clause license,
  * the "License"; You may not use this file except in compliance with the
  * License. You may obtain a copy of the License at:
  *                        opensource.org/licenses/BSD-3-Clause
  *
  ******************************************************************************
  */
/* USER CODE END Header */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __MAIN_H
#define __MAIN_H

#ifdef __cplusplus
extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "stm32f4xx_hal.h"
#include "user_define.h"

/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include <stdarg.h>
#include <stdio.h>
#include "string.h"
#include "stdarg.h"

/* USER CODE END Includes */

/* Exported types ------------------------------------------------------------*/
/* USER CODE BEGIN ET */

/* USER CODE END ET */

/* Exported constants --------------------------------------------------------*/
/* USER CODE BEGIN EC */
#define BLOCKCOLOR 20
#define TITLECOLOR 16
#define FONTRED  1
#define FONTGREEN 2
#define FONTYELLOW 4
#define FONTCYAN   5
#define FONTORANGE 53
/* USER CODE END EC */

/* Exported macro ------------------------------------------------------------*/
/* USER CODE BEGIN EM */
#define IRC_SoftVersion 0x1001
/* USER CODE END EM */

/* Exported functions prototypes ---------------------------------------------*/
void Error_Handler(void);

/* USER CODE BEGIN EFP */

/* USER CODE END EFP */

/* Private defines -----------------------------------------------------------*/

#define CNARGE_PANEL_EMPTY_UNIT_DETECT_PIN GPIO_PIN_2
#define CNARGE_PANEL_EMPTY_UNIT_DETECT_PORT GPIOA


#define BEEP_CON_PIN GPIO_PIN_4
#define BEEP_CON_PORT GPIOA

#define W25QXX_CSS_PIN GPIO_PIN_6
#define W25QXX_CSS_GPIO GPIOA

#define CNARGE_PANEL_FULL_UNIT_DETECT_PIN GPIO_PIN_1
#define CNARGE_PANEL_FULL_UNIT_DETECT_PORT GPIOB

#define HOME_KDY_PIN GPIO_PIN_1
#define HOME_KEY_GPIO GPIOB

#define IMU_I2C1_SCL_Pin GPIO_PIN_6
#define IMU_I2C1_SCL_GPIO_Port GPIOB

#define IMU_I2C1_SDA_Pin GPIO_PIN_7
#define IMU_I2C1_SDA_GPIO_Port GPIOB

#define CONVEYOR_BELT_PIN GPIO_PIN_9
#define CONVEYOR_BELT_GPIO GPIOC

#define FOAM_IN_PLACE_PIN GPIO_PIN_8
#define FOAM_IN_PLACE_GPIO GPIOA

#define OLED_I2C2_SCL_Pin GPIO_PIN_10
#define OLED_I2C2_SCL_GPIO_Port GPIOB
#define OLED_I2C2_SDA_Pin GPIO_PIN_11
#define OLED_I2C2_SDA_GPIO_Port GPIOB

#define FOAM_HEAP_IN_PLACE_PIN GPIO_PIN_15
#define FOAM_HEAP_IN_PLACE_GPIO GPIOB

#define GAP_CON_PIN GPIO_PIN_1
#define GAP_CON_GPIO GPIOC

//#define LED_Pin GPIO_PIN_8
//#define LED_GPIO_Port GPIOC

#define SLOPE_BELT_PIN GPIO_PIN_14
#define SLOPE_BELT_GPIO GPIOB

#define RS485_Dir_Pin GPIO_PIN_13
#define RS485_DIR_GPIO_Port GPIOC
/* USER CODE BEGIN Private defines */

#ifdef  IMU6_T
#define ReadOtherSta    HAL_GPIO_ReadPin(GPIOB,GPIO_PIN_1)
#define ReadWorkSta     HAL_GPIO_ReadPin(GPIOC,GPIO_PIN_0)
#define ReadShutDownSta     HAL_GPIO_ReadPin(GPIOC,GPIO_PIN_14)
extern void lcd_printf(const char *format, ...);
extern void RGBto255RGB(COLOR_RGBC *Rgb,Sepan_RGBC *RGB255);
extern uint8_t FlyClass;
extern uint8_t PanduanColor;
#endif

#ifdef  IRC_T
#define IRC_ORIGIN_CON_PIN GPIO_PIN_5
#define IRC_ORIGIN_CON_GPIO GPIOC

#define IRC_WORK_CON_PIN GPIO_PIN_4
#define IRC_WORK_CON_GPIO GPIOC

#define ReadIrc_Origin  HAL_GPIO_ReadPin(IRC_ORIGIN_CON_GPIO,IRC_ORIGIN_CON_PIN)
#define ReadIrc_Work    HAL_GPIO_ReadPin(IRC_WORK_CON_GPIO,IRC_WORK_CON_PIN)

#endif

/* USER CODE END Private defines */

#ifdef __cplusplus
}
#endif

#endif /* __MAIN_H */

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
